/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Main.java
 *
 * Created on 28-jan-2011, 16:54:15
 */
package nl.maxato.gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.net.URI;
import java.util.ArrayList;
import java.util.Locale;
import java.util.ResourceBundle;
import javax.swing.UIManager;

//xmlunit
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.TableColumn;

import nl.maxato.controller.Controller;
import nl.maxato.domain.Athlete;
import nl.maxato.domain.World;
import nl.maxato.modellen.SpecialiteitTableModel;
import nl.maxato.xmlservices.XMLService;
import nl.maxato.util.ConfigurationFile;
import nl.maxato.util.ParameterNames;
import nl.maxato.xmlservices.ConvertXMLData;

/**
 *
 * @author Danny
 */
public class Main extends javax.swing.JFrame {

    XMLService xmlService;
    List<Athlete> athletes;
    ResourceBundle rb;
    nl.maxato.domain.Club club;
    List<Athlete> adf;
    List<Athlete> oldList;
    Controller controller;
    String language;
    String country;
    Locale locale;
    ConfigurationFile cf;

    /** Creates new form Main */
    public Main(){
        
    }
    public Main(Controller controller, List<Athlete> oldListAthletes) {
        makeComponents();
        cf = new ConfigurationFile();
        oldList = oldListAthletes;
        xmlService = XMLService.getInstance();
        this.controller = controller;
        translateGUI(controller.getLanguague(cf.getLanguage()));
        fillTable();
    }

    private void jButton_Bereken_SpecialiteitActionPerformed(java.awt.event.ActionEvent evt) {
        SpecialiteitTableModel stm = new SpecialiteitTableModel(controller.calculateSpecialty(jComboBox_Strenght.getSelectedItem().toString(), jComboBox_Stamina.getSelectedItem().toString(), jComboBox_Speed.getSelectedItem().toString(), jComboBox_Agility.getSelectedItem().toString(), jComboBox_Jump.getSelectedItem().toString(), jComboBox_Throwing.getSelectedItem().toString(), rb));
        stm.setColumnNames(rb.getString("DISCIPLINE"), rb.getString("VALUE"));
        jTable_CalculateSpecialty.setModel(stm);
        jTable_CalculateSpecialty.setAutoCreateRowSorter(true);
        jTable_CalculateSpecialty.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        TableColumn column = jTable_CalculateSpecialty.getColumnModel().getColumn(0);
        column.setPreferredWidth(130);
        column = jTable_CalculateSpecialty.getColumnModel().getColumn(1);
        column.setPreferredWidth(50);
        jTable_CalculateSpecialty.setVisible(true);

    }

    private void jMenuItem_NEDERLANDSActionPerformed(java.awt.event.ActionEvent evt) {
        translateGUI(controller.getLanguague("nl"));
    }

    private void jMenuItem_ENGELSActionPerformed(java.awt.event.ActionEvent evt) {
        translateGUI(controller.getLanguague("en"));
    }

    private void jMenuItem_POLISHActionPerformed(ActionEvent evt) {
        translateGUI(controller.getLanguague("pl"));
    }

    private void jMenuItem_DEUTSCHActionPerformed(ActionEvent evt) {
        translateGUI(controller.getLanguague("de"));
    }

    private void jMenuItem_FRANCAISActionPerformed(ActionEvent evt) {
        translateGUI(controller.getLanguague("fr"));
    }

    private void jMenuItem_ESPANOLActionPerformed(ActionEvent evt) {
        translateGUI(controller.getLanguague("es"));
    }

    private void jMenuItem_PORTUGUESEActionPerformed(ActionEvent evt) {
        translateGUI(controller.getLanguague("pt"));
    }

    private void jMenuItem_ITALIANActionPerformed(ActionEvent evt) {
        translateGUI(controller.getLanguague("it"));
    }

    private void jMenuItem_GREEKActionPerformed(ActionEvent evt) {
        translateGUI(controller.getLanguague("el"));
    }

    private void jMenuItem_CZECHActionPerformed(ActionEvent evt) {
        translateGUI(controller.getLanguague("cs"));
    }

    private void jMenuItem_ESTONIANActionPerformed(ActionEvent evt) {
        translateGUI(controller.getLanguague("et"));
    }

    private void jMenuItem_RUSSIANActionPerformed(ActionEvent evt) {
        translateGUI(controller.getLanguague("ru"));
    }
    private void jMenuItem_HUNGARIANActionPerformed(ActionEvent evt) {
        translateGUI(controller.getLanguague("hu"));
    }
    private void jMenuItem_BesteOnderdeelActionPerformed(ActionEvent evt) {
        CalculateDisciplineGUI bog = new CalculateDisciplineGUI();
        bog.setVisible(true);
    }
    
	private void jMenuItem_BesteTeamActionPerformed(ActionEvent evt) {
		BestTeamGUI btg = new BestTeamGUI();
		btg.setVisible(true);	
	}

    private void jMenuItem_VerschillenActionPerformed(java.awt.event.ActionEvent evt) {
        CompareAthletesGUI vergelijkerGUI = new CompareAthletesGUI();
        vergelijkerGUI.setVisible(true);
    }

    private void jMenuItem_AFSLUITENActionPerformed(java.awt.event.ActionEvent evt) {
        System.exit(0);
    }

    private void jMenuItem_SalarisActionPerformed(ActionEvent evt) {
        SalarisBerekenaarGUI salarisGUI = new SalarisBerekenaarGUI();
        salarisGUI.setVisible(true);
    }

    private void setDataInGui() {
        club = xmlService.convertClubData();
        adf = xmlService.xmlToAthletes();

        nl.maxato.domain.Calendar cv = xmlService.convertCalendarData();
        ArrayList<String> cw = controller.getNextThreeCompetition(cv, rb);
        jLabel_Calendar1.setText(cw.get(0));
        jLabel_Calendar2.setText(cw.get(1));
        jLabel_Calendar3.setText(cw.get(2));
        jLabel_Calendar4.setText(cw.get(3));
        jLabel_Calendar5.setText(cw.get(4));

        World w = xmlService.worldDataOmzetten();
        for (int i = 0; i < w.getContinent().size(); i++) {
            for (int x = 0; x < w.getContinent().get(i).getNationsList().size(); x++) {
                if (w.getContinent().get(i).getNationsList().get(x).getIdNation() == Integer.parseInt(club.getNationId())) {
                    label_Country.setText(w.getContinent().get(i).getNationsList().get(x).getNameNation());
                    for (int z = 0; z < w.getContinent().get(i).getNationsList().get(x).getRegiosList().size(); z++) {
                        if (w.getContinent().get(i).getNationsList().get(x).getRegiosList().get(z).getIdRegio() == Integer.parseInt(club.getRegionId())) {
                            label_province.setText(w.getContinent().get(i).getNationsList().get(x).getRegiosList().get(z).getNameRegio());
                        }
                    }
                }
            }
        }
        label_leagueId.setText(club.getLeagueId());
        labelTeamname.setText(club.getTeamName());
        labelFounded.setText(club.dateToString());
        labelTeamId.setText(club.getTeamId());
        labelUser.setText(club.getOwner());

        //Totaal verschillen met de vorige keer
        label_Age.setText(Integer.toString(controller.getAgeDifference()));
        label_Wage.setText(Integer.toString(controller.getWageDifference()));
        label_Maxid.setText(Integer.toString(controller.getMaxidDifference()));
        label_Experience.setText(Integer.toString(controller.getExperienceDifference()));
        label_Fans.setText(Integer.toString(controller.getFansDifference()));
        label_Strenght.setText(Integer.toString(controller.getStrenghtDifference()));
        label_Stamina.setText(Integer.toString(controller.getStaminaDifference()));
        label_Speed.setText(Integer.toString(controller.getSpeedDifference()));
        label_Agility.setText(Integer.toString(controller.getSpeedDifference()));
        label_Jump.setText(Integer.toString(controller.getJumpDifference()));
        label_Throwing.setText(Integer.toString(controller.getThrowingDifference()));
        label_Specialty1.setText(Integer.toString(controller.getSpecialty1Difference()));
        label_Specialty2.setText(Integer.toString(controller.getSpecialty2Difference()));

        //Center bereken verschil met vorige keer
        if (oldList == null) {
            Athlete a = new Athlete(0, 0, "", "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
            oldList = new ArrayList<Athlete>();
            oldList.add(a);
            jLabel_TotalAthletesOld.setText("0");
            jLabel_TotalAthlewsDifference.setText(Integer.toString(adf.size()));
        } else {
            jLabel_TotalAthletesOld.setText(Integer.toString(oldList.size()));
            jLabel_TotalAthlewsDifference.setText(Integer.toString(adf.size() - oldList.size()));
        }

        jLabel_TotalYouthOld.setText(Integer.toString(controller.getTotalStatistics(oldList, "youth")));
        jLabel_TotalInjuriesOld.setText(Integer.toString(controller.getTotalStatistics(oldList, "injuries")));
        jLabel_TotalFansOld.setText(Integer.toString(controller.getTotalStatistics(oldList, "fans")));
        jLabel_FansDifferenceOld.setText(twoDecimalPlaces(controller.getAveragedStatistics(oldList, "fans")).toString());
        jLabel_TotalWageOld.setText(Integer.toString(controller.getTotalStatistics(oldList, "wage")));
        jLabel_WageDifferenceOld.setText(twoDecimalPlaces(controller.getAveragedStatistics(oldList, "wage")).toString());
        jLabel_TotalMaxidOld.setText(Integer.toString(controller.getTotalStatistics(oldList, "maxid")));
        jLabel_MAXIDDifferenceOld.setText(twoDecimalPlaces(controller.getAveragedStatistics(oldList, "maxid")).toString());
        jLabel_AgeDifferenceOld.setText(twoDecimalPlaces(controller.getAveragedStatistics(oldList, "age")).toString());
        jLabel_FormDifferenceOld.setText(twoDecimalPlaces(controller.getAveragedStatistics(oldList, "form")).toString());
        jLabel_CareDifferenceOld.setText(twoDecimalPlaces(controller.getAveragedStatistics(oldList, "care")).toString());
        jLabel_ExperienceDifferenceOld.setText(twoDecimalPlaces(controller.getAveragedStatistics(oldList, "experience")).toString());
        jLabel_MoodDifferenceOld.setText(twoDecimalPlaces(controller.getAveragedStatistics(oldList, "mood")).toString());

        jLabel_TotalAthletesNew.setText(Integer.toString(adf.size()));
        jLabel_TotalYouthNew.setText(Integer.toString(controller.getTotalStatistics(adf, "youth")));
        jLabel_TotalInjuriesNew.setText(Integer.toString(controller.getTotalStatistics(adf, "injuries")));
        jLabel_TotalFansNew.setText(Integer.toString(controller.getTotalStatistics(adf, "fans")));
        jLabel_FansDifferenceNew.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "fans")).toString());
        jLabel_TotalWageNew.setText(Integer.toString(controller.getTotalStatistics(adf, "wage")));
        jLabel_WageDifferenceNew.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "wage")).toString());
        jLabel_TotalMaxidNew.setText(Integer.toString(controller.getTotalStatistics(adf, "maxid")));
        jLabel_MAXIDDiferenceNew.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "maxid")).toString());
        jLabel_AgeDifferenceNew.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "age")).toString());
        jLabel_FormDifferenceNew.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "form")).toString());
        jLabel_CareDifferenceNew.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "care")).toString());
        jLabel_ExperienceDifferenceNew.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "experience")).toString());
        jLabel_MoodDifferenceNew.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "mood")).toString());


        jLabel_TotalYouthDifference.setText(Integer.toString(controller.getTotalStatistics(adf, "youth") - controller.getTotalStatistics(oldList, "youth")));
        jLabel_TotalInjuriesDifference.setText(Integer.toString(controller.getTotalStatistics(adf, "injuries") - controller.getTotalStatistics(oldList, "injuries")));
        jLabel_TotalFansDifference.setText(Integer.toString(controller.getTotalStatistics(adf, "fans") - controller.getTotalStatistics(oldList, "fans")));
        jLabel_FansDifference.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "fans") - controller.getAveragedStatistics(oldList, "fans")).toString());
        jLabel_TotalWageDifference.setText(Integer.toString(controller.getTotalStatistics(adf, "wage") - controller.getTotalStatistics(oldList, "wage")));
        jLabel_WageDifference.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "wage") - controller.getAveragedStatistics(oldList, "wage")).toString());
        jLabel_TotalMaxid.setText(Integer.toString(controller.getTotalStatistics(adf, "maxid") - controller.getTotalStatistics(oldList, "maxid")));
        jLabel_MAXIDDifference.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "maxid") - controller.getAveragedStatistics(oldList, "maxid")).toString());
        jLabel_AgeDifference.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "age") - controller.getAveragedStatistics(oldList, "age")).toString());
        jLabel_FormDifference.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "form") - controller.getAveragedStatistics(oldList, "form")).toString());
        jLabel_CareDifference.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "care") - controller.getAveragedStatistics(oldList, "care")).toString());
        jLabel_ExperienceDifference.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "experience") - controller.getAveragedStatistics(oldList, "experience")).toString());
        jLabel_MoodDifference.setText(twoDecimalPlaces(controller.getAveragedStatistics(adf, "mood") - controller.getAveragedStatistics(oldList, "mood")).toString());
    }

    private static java.math.BigDecimal twoDecimalPlaces(final double d) {
        return new java.math.BigDecimal(d).setScale(2, java.math.RoundingMode.HALF_UP);

    }

    private void translateGUI(ResourceBundle b) {
        this.rb = b;
//        SpecialiteitTableModel stm = new SpecialiteitTableModel(controller.calculateSpecialty(jComboBox_Strenght.getSelectedItem().toString(), jComboBox_Stamina.getSelectedItem().toString(), jComboBox_Speed.getSelectedItem().toString(), jComboBox_Agility.getSelectedItem().toString(), jComboBox_Jump.getSelectedItem().toString(), jComboBox_Throwing.getSelectedItem().toString(), rb));
//        stm.setColumnNames(rb.getString("DISCIPLINE"), rb.getString("VALUE"));
//        jTable_CalculateSpecialty.setModel(stm);
        jButton_Bereken_SpecialiteitActionPerformed(null);
        //Title of the program
        this.setTitle(ParameterNames.guiVersion);
        //Menubar items
        jMenu_File.setText(b.getString("FILE"));
        jMenu_Calculate.setText(b.getString("CALCULATE"));
        jMenu_Language.setText(b.getString("LANGUAGE"));

        //Menu items in menu
        JMenuItem_Close.setText(b.getString("CLOSE"));
        jMenuItem_English.setText(ParameterNames.languageENGLISH);
        jMenuItem_Dutch.setText(ParameterNames.languageDUTCH);
        jMenuItem_Polish.setText(ParameterNames.languagePOLISH);
        jMenuItem_Deutsch.setText(ParameterNames.languageDEUTSCH);
        jMenuItem_Francais.setText(ParameterNames.languageFRANCAIS);
        jMenuItem_Espanol.setText(ParameterNames.languageESPANOL);
        jMenuItem_Portuguese.setText(ParameterNames.languagePORTUGUESE);
        jMenuItem_Czech.setText(ParameterNames.languageCZECH);
        jMenuItem_Greek.setText(ParameterNames.languageGREEK);
        jMenuItem_Italian.setText(ParameterNames.languageITALIAN);
        jMenuItem_Estonian.setText(ParameterNames.languageESTONIAN);
        jMenuItem_Russian.setText(ParameterNames.languageRUSSIAN);
        jMenuItem_Hungarian.setText(ParameterNames.languageHungarian);
        jMenuItem_Differences.setText(b.getString("COMPARE_ATHLETES"));
        jMenuItem_BestDiscipline.setText(b.getString("DISCIPLINES"));
        jMenuItem_Wage.setText(b.getString("WAGE"));

        //Labels 
        jPanelTeaminformation.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(),b.getString("TEAMINFORMATION")));
        jLabel_Teamname.setText(b.getString("TEAMNAME") + ":");
        jLabel_Founded.setText(b.getString("FOUNDED") + ":");
        jLabel_User.setText(b.getString("OWNER") + ":");
        jLabel_TeamId.setText(b.getString("TEAMID") + ":");
        jLabel_Country.setText(b.getString("COUNTRY") + ":");
        jLabel_Province.setText(b.getString("PROVINCE") + ":");
        jLabel_CompetitionId.setText(b.getString("LEAGUEID") + ":");


        jPanel6.setBorder(BorderFactory.createTitledBorder(b.getString("CALCULATE_SPECIALTY")));
        jLabel_Strenght.setText(b.getString("STRENGHT") + ":");
        jLabel_Stamina.setText(b.getString("STAMINA") + ":");
        jLabel_Speed.setText(b.getString("SPEED") + ":");
        jLabel_Agility.setText(b.getString("AGILITY") + ":");
        jLabel_Jump.setText(b.getString("JUMP") + ":");
        jLabel_Throwing.setText(b.getString("THROWING") + ":");

        jPanelAveragedStatics.setBorder(BorderFactory.createTitledBorder(b.getString("AVERAGE_STATISTICS")));
        jLabel_Age.setText(b.getString("AGE") + ":");
        jLabel_Wage.setText(b.getString("WAGE") + ":");
        jLabel_Maxid.setText(b.getString("MAXID") + ":");
        jLabel_Experience.setText(b.getString("EXPERIENCE") + ":");
        jLabel_Fans.setText(b.getString("FANS") + ":");
        jLabel_StrenghtGS.setText(b.getString("STRENGHT") + ":");
        jLabel_StaminaGS.setText(b.getString("STAMINA") + ":");
        jLabel_SpeedGS.setText(b.getString("SPEED") + ":");
        jLabel_AgilityGS.setText(b.getString("AGILITY") + ":");
        jLabel_ThrowingGS.setText(b.getString("THROWING") + ":");
        jLabel_JumpGS.setText(b.getString("JUMP") + ":");

        jLabel_Specialty1.setText(b.getString("SPECIALTY1") + ":");
        jLabel_Specialty2.setText(b.getString("SPECIALTY2") + ":");

        jButton_Calculate_Specialty.setText(b.getString("CALCULATE"));
//        jlabel_Copyright.setText(b.getString("VERSION"));
//        jLabel_MadeBy.setText(b.getString("COPYRIGHT"));
//
//        //Buttons

        jPanel8.setBorder(BorderFactory.createTitledBorder(b.getString("CALENDAR")));
        jPanel11.setBorder(BorderFactory.createTitledBorder(b.getString("DIFFERENCES_WITH_LAST_TIME")));

        jLabel_Athletes.setText(b.getString("NUMBER_OF_ATHLETES") + ":");
        jLabel_Youth.setText(b.getString("NUMBER_OF_YOUTH") + ":");
        jLabel_Injury.setText(b.getString("INJURIES") + ":");
        jLabel_Fans1.setText(b.getString("NUMBER_OF_FANS") + ":");
        jLabel_AvgFans.setText(b.getString("AVERAGE_FANS") + ":");
        jLabel_WageStatics.setText(b.getString("TOTAL_WAGE") + ":");
        jLabel_AvgWage.setText(b.getString("AVERAGE_WAGE") + ":");
        jLabel_MAXID.setText(b.getString("TOTAL_MAXID") + ":");
        jLabel_AvgMaxid.setText(b.getString("AVERAGE_MAXID") + ":");
        jLabel_AvgAge.setText(b.getString("AVERAGE_AGE") + ":");
        jLabel_AvgForm.setText(b.getString("AVERAGE_FORM") + ":");
        jLabel_AvgCare.setText(b.getString("AVERAGE_CARE") + ":");
        jLabel_AvgExperience.setText(b.getString("AVERAGE_EXPERIENCE") + ":");
        jLabel_AvgMood.setText(b.getString("AVERAGE_MOOD") + ":");
//        jLabel_SPECIALITEIT2.setText(b.getString("SPECIALITEIT2"));

        jLabel_Difference.setText(b.getString("DIFFERENCE"));
        jLabel_DateNew.setText(b.getString("TODAY"));
        jLabel_DateOld.setText(b.getString("LAST_UPDATE"));
        jLabel_Date.setText(b.getString("DATE"));

        jPanel16.setBorder(BorderFactory.createTitledBorder(b.getString("MAXATO_INFORMATION")));
        jLabel_MadeBy.setText(ParameterNames.guiCopyright);
        jLabel_VisiteWebpage.setText(b.getString("VISIT_OUR_WEBSITE") + ":");
        jLabel_Webpage.setText(ParameterNames.guiWebsite);
        jLabel_Copyright.setText(ParameterNames.guiVersion);
        jLabel_Email.setText(ParameterNames.guiEmail);


        setDataInGui();
    }

    /**
     * @param args the command line arguments
     */
    public static void main(final String args[]) {
        //zet de GUI om in Windows-look
        try {
            
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        } catch (Exception e) {
            System.out.println("Unable to load Windows look and feel");
        }
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                // new Main("NL").setVisible(true); //args[0]
            }
        });
    }

    /** Returns an ImageIcon, or null if the path was invalid. */
    protected static ImageIcon createImageIcon(String path) {
        //  java.net.URL imgURL = path;
        if (path != null) {
            return new ImageIcon(path);
        } else {
            System.err.println("Couldn't find image file: " + path);
            return null;
        }
    }
    // Variables declaration - do not modify   
    private javax.swing.JLabel jLabel_AgilityGS;
    private javax.swing.JLabel jLabel_StrenghtGS;
    private javax.swing.JLabel jLabel_SpeedGS;
    private javax.swing.JLabel jLabel_JumpGS;
    private javax.swing.JLabel jLabel_StaminaGS;
    private javax.swing.JLabel jLabel_ThrowingGS;
    private javax.swing.JMenuItem JMenuItem_Close;
    private javax.swing.JButton jButton_Calculate_Specialty;
    private javax.swing.JComboBox jComboBox_Strenght;
    private javax.swing.JComboBox jComboBox_Agility;
    private javax.swing.JComboBox jComboBox_Speed;
    private javax.swing.JComboBox jComboBox_Jump;
    private javax.swing.JComboBox jComboBox_Stamina;
    private javax.swing.JComboBox jComboBox_Throwing;
    private javax.swing.JLabel jLabel_CompetitionId;
    private javax.swing.JLabel jLabel_Strenght;
    private javax.swing.JLabel jLabel_Country;
    private javax.swing.JLabel jLabel_Agility;
    private javax.swing.JLabel jLabel_Province;
    private javax.swing.JLabel jLabel_Speed;
    private javax.swing.JLabel jLabel_Jump;
    private javax.swing.JLabel jLabel_TeamId;
    private javax.swing.JLabel jLabel_Teamname;
    private javax.swing.JLabel jLabel_Stamina;
    private javax.swing.JLabel jLabel_Throwing;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem_English;
    private javax.swing.JMenuItem jMenuItem_Dutch;
    private javax.swing.JMenuItem jMenuItem_Polish;
    private javax.swing.JMenuItem jMenuItem_Deutsch;
    private javax.swing.JMenuItem jMenuItem_Espanol;
    private javax.swing.JMenuItem jMenuItem_Francais;
    private javax.swing.JMenuItem jMenuItem_Portuguese;
    private javax.swing.JMenuItem jMenuItem_Italian;
    private javax.swing.JMenuItem jMenuItem_Czech;
    private javax.swing.JMenuItem jMenuItem_Greek;
    private javax.swing.JMenuItem jMenuItem_Hungarian;
    private javax.swing.JMenuItem jMenuItem_Estonian;
    private javax.swing.JMenuItem jMenuItem_Russian;
    private javax.swing.JMenuItem jMenuItem_Differences;
    private javax.swing.JMenuItem jMenuItem_BestDiscipline;
    private javax.swing.JMenuItem jMenuItem_Wage;
    private javax.swing.JMenuItem jMenuItem_BestTeam;
    private javax.swing.JMenu jMenu_File;
    private javax.swing.JMenu jMenu_Calculate;
    private javax.swing.JMenu jMenu_Language;
    private javax.swing.JPanel jPanelTeaminformation;
    private javax.swing.JPanel jPanelCentrum;
    private javax.swing.JPanel jPanelAveragedStatics;
    private javax.swing.JPanel jPanelEast;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private ImagePanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private ImagePanel jPanel12;
    private ImagePanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private ImagePanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanelWest;
    private javax.swing.JLabel labelTeamId;
    private javax.swing.JLabel labelTeamname;
    private javax.swing.JLabel label_Country;
    private javax.swing.JLabel label_leagueId;
    private javax.swing.JLabel label_province;
    private javax.swing.JLabel jLabel_Age;
    private javax.swing.JLabel label_Age;
    private javax.swing.JLabel jLabel_Wage;
    private javax.swing.JLabel label_Wage;
    private javax.swing.JLabel jLabel_Maxid;
    private javax.swing.JLabel label_Maxid;
    private javax.swing.JLabel labelFounded;
    private javax.swing.JLabel jLabel_Founded;
    private javax.swing.JLabel jLabel_Experience;
    private javax.swing.JLabel label_Experience;
    private javax.swing.JLabel label_Strenght;
    private javax.swing.JLabel label_Speed;
    private javax.swing.JLabel label_Agility;
    private javax.swing.JLabel label_Jump;
    private javax.swing.JLabel label_Throwing;
    private javax.swing.JLabel jLabel_Specialty1;
    private javax.swing.JLabel label_Specialty1;
    private javax.swing.JLabel jLabel_Specialty2;
    private javax.swing.JLabel label_Specialty2;
    private javax.swing.JLabel label_Stamina;
    private javax.swing.JLabel jLabel_Fans;
    private javax.swing.JLabel label_Fans;
    private javax.swing.JLabel jLabel_Calendar1;
    private javax.swing.JLabel jLabel_Calendar2;
    private javax.swing.JLabel jLabel_Calendar3;
    private javax.swing.JLabel jLabel_Calendar4;
    private javax.swing.JLabel jLabel_Calendar5;
    private javax.swing.JLabel jLabel_Athletes;
    private javax.swing.JLabel jLabel_Youth;
    private javax.swing.JLabel jLabel_Injury;
    private javax.swing.JLabel jLabel_Fans1;
    private javax.swing.JLabel jLabel_AvgFans;
    private javax.swing.JLabel jLabel_WageStatics;
    private javax.swing.JLabel jLabel_AvgWage;
    private javax.swing.JLabel jLabel_MAXID;
    private javax.swing.JLabel jLabel_AvgMaxid;
    private javax.swing.JLabel jLabel_AvgAge;
    private javax.swing.JLabel jLabel_AvgForm;
    private javax.swing.JLabel jLabel_AvgCare;
    private javax.swing.JLabel jLabel_AvgExperience;
    private javax.swing.JLabel jLabel_AvgMood;
    private javax.swing.JLabel jLabel_AgeDifferenceOld;
    private javax.swing.JLabel jLabel_WageDifference;
    private javax.swing.JLabel jLabel_FansDifference;
    private javax.swing.JLabel jLabel_TotalFansOld;
    private javax.swing.JLabel jLabel_TotalWageOld;
    private javax.swing.JLabel jLabel_MAXIDDifferenceOld;
    private javax.swing.JLabel jLabel_ExperienceDifferenceOld;
    private javax.swing.JLabel jLabel_FormDifferenceOld;
    private javax.swing.JLabel jLabel_CareDifferenceOld;
    private javax.swing.JLabel jLabel_Email;
    private javax.swing.JLabel jLabel_MoodDifferenceOld;
    private javax.swing.JLabel jLabel_TotalMaxidOld;
    private javax.swing.JLabel jLabel_TotalInjuriesOld;
    private javax.swing.JLabel jLabel_TotalAthletesOld;
    private javax.swing.JLabel jLabel_TotalYouthOld;
    private javax.swing.JLabel jLabel_AgeDifferenceNew;
    private javax.swing.JLabel jLabel_WageDifferenceNew;
    private javax.swing.JLabel jLabel_FansDifferenceNew;
    private javax.swing.JLabel jLabel_TotalFansNew;
    private javax.swing.JLabel jLabel_TotalWageNew;
    private javax.swing.JLabel jLabel_MAXIDDiferenceNew;
    private javax.swing.JLabel jLabel_ExperienceDifferenceNew;
    private javax.swing.JLabel jLabel_FormDifferenceNew;
    private javax.swing.JLabel jLabel_CareDifferenceNew;
    private javax.swing.JLabel jLabel_MoodDifferenceNew;
    private javax.swing.JLabel jLabel_TotalMaxidNew;
    private javax.swing.JLabel jLabel_TotalInjuriesNew;
    private javax.swing.JLabel jLabel_TotalAthletesNew;
    private javax.swing.JLabel jLabel_TotalYouthNew;
    private javax.swing.JLabel jLabel_TotalAthlewsDifference;
    private javax.swing.JLabel jLabel_TotalYouthDifference;
    private javax.swing.JLabel jLabel_TotalInjuriesDifference;
    private javax.swing.JLabel jLabel_TotalFansDifference;
    private javax.swing.JLabel jLabel_FansDifferenceOld;
    private javax.swing.JLabel jLabel_TotalWageDifference;
    private javax.swing.JLabel jLabel_WageDifferenceOld;
    private javax.swing.JLabel jLabel_TotalMaxid;
    private javax.swing.JLabel jLabel_MAXIDDifference;
    private javax.swing.JLabel jLabel_AgeDifference;
    private javax.swing.JLabel jLabel_FormDifference;
    private javax.swing.JLabel jLabel_CareDifference;
    private javax.swing.JLabel jLabel_ExperienceDifference;
    private javax.swing.JLabel jLabel_MoodDifference;
    private javax.swing.JLabel jLabel_Difference;
    private javax.swing.JLabel jLabel_DateNew;
    private javax.swing.JLabel jLabel_DateOld;
    private javax.swing.JLabel jLabel_Date;
    private javax.swing.JLabel jLabel_MadeBy;
    private javax.swing.JLabel jLabel_VisiteWebpage;
    private javax.swing.JLabel jLabel_Copyright;
    private javax.swing.JLabel jLabel_Webpage;
    private javax.swing.JTable jTable_CalculateSpecialty;
    private javax.swing.JScrollPane jScrollPane;
    private javax.swing.JLabel jLabel_User;
    private javax.swing.JLabel labelUser;
    // End of variables declaration                   

    private void makeComponents() {
        this.setDefaultCloseOperation(CalculateDisciplineGUI.EXIT_ON_CLOSE);
        //this.setSize(1000, 600);
        this.setLayout(new BorderLayout());
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width - 1000) / 2, (screenSize.height - 660) / 2, 1000, 660);
        setResizable(false);


        //Creating the MenuBar and adding components
        jMenuBar1 = new JMenuBar();
        jMenu_File = new JMenu();
        jMenu_Calculate = new JMenu();
        jMenu_Language = new JMenu();
        jMenuBar1.add(jMenu_File);
        jMenuBar1.add(jMenu_Calculate);
        jMenuBar1.add(jMenu_Language);
        ImageIcon icon;
        icon = createImageIcon("img/close.png");
        JMenuItem_Close = new JMenuItem(icon);
        JMenuItem_Close.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_AFSLUITENActionPerformed(evt);
            }
        });

        icon = createImageIcon("img/gb.png");
        jMenuItem_English = new JMenuItem(icon);
        jMenuItem_English.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_ENGELSActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/nl.png");
        jMenuItem_Dutch = new JMenuItem(icon);
        jMenuItem_Dutch.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_NEDERLANDSActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/pl.png");
        jMenuItem_Polish = new JMenuItem(icon);
        jMenuItem_Polish.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_POLISHActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/et.png");
        jMenuItem_Estonian = new JMenuItem(icon);
        jMenuItem_Estonian.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_ESTONIANActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/ru.png");
        jMenuItem_Russian = new JMenuItem(icon);
        jMenuItem_Russian.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_RUSSIANActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/de.png");
        jMenuItem_Deutsch = new JMenuItem(icon);
        jMenuItem_Deutsch.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_DEUTSCHActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/pt.png");
        jMenuItem_Portuguese = new JMenuItem(icon);
        jMenuItem_Portuguese.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_PORTUGUESEActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/fr.png");
        jMenuItem_Francais = new JMenuItem(icon);
        jMenuItem_Francais.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_FRANCAISActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/es.png");
        jMenuItem_Espanol = new JMenuItem(icon);
        jMenuItem_Espanol.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_ESPANOLActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/gr.png");
        jMenuItem_Greek = new JMenuItem(icon);
        jMenuItem_Greek.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_GREEKActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/cz.png");
        jMenuItem_Czech = new JMenuItem(icon);
        jMenuItem_Czech.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_CZECHActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/it.png");
        jMenuItem_Italian = new JMenuItem(icon);
        jMenuItem_Italian.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_ITALIANActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/hu.png");
        jMenuItem_Hungarian = new JMenuItem(icon);
        jMenuItem_Hungarian.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_HUNGARIANActionPerformed(evt);
            }
        });        
        icon = createImageIcon("img/updown.png");
        jMenuItem_Differences = new JMenuItem(icon);
        jMenuItem_Differences.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_VerschillenActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/running.png");
        jMenuItem_BestDiscipline = new JMenuItem(icon);
        jMenuItem_BestDiscipline.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_BesteOnderdeelActionPerformed(evt);
            }
        });
        icon = createImageIcon("img/star.png");
        jMenuItem_BestTeam = new JMenuItem(icon);
        jMenuItem_BestTeam.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_BesteTeamActionPerformed(evt);
            }

        });
        
        icon = createImageIcon("img/money.png");
        jMenuItem_Wage = new JMenuItem(icon);
        jMenuItem_Wage.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_SalarisActionPerformed(evt);
            }
        });
        jMenu_File.add(JMenuItem_Close);
        jMenu_Calculate.add(jMenuItem_Differences);
        jMenu_Calculate.add(jMenuItem_BestDiscipline);
        jMenu_Calculate.add(jMenuItem_Wage);
        jMenu_Calculate.add(jMenuItem_BestTeam);
        jMenu_Language.add(jMenuItem_Czech);
        jMenu_Language.add(jMenuItem_Deutsch);
        jMenu_Language.add(jMenuItem_Estonian);
        jMenu_Language.add(jMenuItem_English);
        jMenu_Language.add(jMenuItem_Greek);
        jMenu_Language.add(jMenuItem_Espanol);
        jMenu_Language.add(jMenuItem_Francais);
        jMenu_Language.add(jMenuItem_Hungarian);
        jMenu_Language.add(jMenuItem_Italian);
        jMenu_Language.add(jMenuItem_Dutch);
        jMenu_Language.add(jMenuItem_Polish);
        jMenu_Language.add(jMenuItem_Portuguese);
        jMenu_Language.add(jMenuItem_Russian);
        

        jPanelCentrum = new JPanel();
        jPanelCentrum.setLayout(new BorderLayout());

        //Panel Teaminformatie
        jPanelTeaminformation = new JPanel();
       // new ImagePanel(new ImageIcon("img/test.png").getImage());
        jPanelTeaminformation.setLayout(new GridLayout(0,2,5,5));
        jPanelTeaminformation.setPreferredSize(new Dimension(200, 165));

        jPanelTeaminformation.add(jLabel_Teamname = new JLabel());
        jPanelTeaminformation.add(labelTeamname = new JLabel());
        jPanelTeaminformation.add(jLabel_Founded = new JLabel());
        jPanelTeaminformation.add(labelFounded = new JLabel());
        jPanelTeaminformation.add(jLabel_User = new JLabel());
        jPanelTeaminformation.add(labelUser = new JLabel());
        jPanelTeaminformation.add(jLabel_TeamId = new JLabel());
        jPanelTeaminformation.add(labelTeamId = new JLabel());
        jPanelTeaminformation.add(jLabel_Country = new JLabel());
        jPanelTeaminformation.add(label_Country = new JLabel());
        jPanelTeaminformation.add(jLabel_Province = new JLabel());
        jPanelTeaminformation.add(label_province = new JLabel());
        jPanelTeaminformation.add(jLabel_CompetitionId = new JLabel());
        jPanelTeaminformation.add(label_leagueId = new JLabel());

        //Panel Teaminformatie
        jPanelAveragedStatics = new JPanel(new GridLayout(0,2,20,5));
        //jPanelAveragedStatics.setBackground(new Color(217, 229, 233));
        jPanelAveragedStatics.setPreferredSize(new Dimension(200, 125));

        jPanelAveragedStatics.add(jLabel_Age = new JLabel());
        jPanelAveragedStatics.add(label_Age = new JLabel("", JLabel.RIGHT));
        jPanelAveragedStatics.add(jLabel_Maxid = new JLabel());
        jPanelAveragedStatics.add(label_Maxid = new JLabel("", JLabel.RIGHT));
        jPanelAveragedStatics.add(jLabel_Wage = new JLabel());
        jPanelAveragedStatics.add(label_Wage = new JLabel("", JLabel.RIGHT));
        jPanelAveragedStatics.add(jLabel_Fans = new JLabel());
        jPanelAveragedStatics.add(label_Fans = new JLabel("", JLabel.RIGHT));
        jPanelAveragedStatics.add(jLabel_Experience = new JLabel());
        jPanelAveragedStatics.add(label_Experience = new JLabel("", JLabel.RIGHT));
        jPanelAveragedStatics.add(jLabel_StrenghtGS = new JLabel());
        jPanelAveragedStatics.add(label_Strenght = new JLabel("", JLabel.RIGHT));
        jPanelAveragedStatics.add(jLabel_StaminaGS = new JLabel());
        jPanelAveragedStatics.add(label_Stamina = new JLabel("", JLabel.RIGHT));
        jPanelAveragedStatics.add(jLabel_SpeedGS = new JLabel());
        jPanelAveragedStatics.add(label_Speed = new JLabel("", JLabel.RIGHT));
        jPanelAveragedStatics.add(jLabel_AgilityGS = new JLabel());
        jPanelAveragedStatics.add(label_Agility = new JLabel("", JLabel.RIGHT));
        jPanelAveragedStatics.add(jLabel_JumpGS = new JLabel());
        jPanelAveragedStatics.add(label_Jump = new JLabel("", JLabel.RIGHT));
        jPanelAveragedStatics.add(jLabel_ThrowingGS = new JLabel());
        jPanelAveragedStatics.add(label_Throwing = new JLabel("", JLabel.RIGHT));
        jPanelAveragedStatics.add(jLabel_Specialty1 = new JLabel());
        jPanelAveragedStatics.add(label_Specialty1 = new JLabel("", JLabel.RIGHT));
        jPanelAveragedStatics.add(jLabel_Specialty2 = new JLabel());
        jPanelAveragedStatics.add(label_Specialty2 = new JLabel("", JLabel.RIGHT));

        jPanel16 = new JPanel();
       // jPanel16.setBackground(new Color(217, 229, 233));
        jPanel16.setLayout(new GridLayout(6, 0));
        jPanel16.setPreferredSize(new Dimension(200, 160));
        jPanel16.add(jLabel_Copyright = new JLabel());
        jPanel16.add(jLabel_MadeBy = new JLabel());
        jPanel16.add(new JLabel());

        jPanel16.add(jLabel_VisiteWebpage = new JLabel());
        jPanel16.add(jLabel_Webpage = new JLabel());
        jLabel_Webpage.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        jLabel_Webpage.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() > 0) {
                    if (Desktop.isDesktopSupported()) {
                        Desktop desktop = Desktop.getDesktop();
                        try {
                            URI uri = new URI("http://maxatotool.atwebpages.com");
                            desktop.browse(uri);
                        } catch (Exception ex) {
                            // do nothing
                        }
                    }
                }
            }
        });
        jPanel16.add(jLabel_Email = new JLabel());


        jPanelWest = new JPanel();
        jPanelWest.setLayout(new BorderLayout());
        jPanelWest.add(BorderLayout.NORTH, jPanelTeaminformation);
        jPanelWest.add(BorderLayout.CENTER, jPanelAveragedStatics);
        jPanelWest.add(BorderLayout.SOUTH, jPanel16);

        jPanel6 = new JPanel(new GridLayout(0,2,20,5));
       // jPanel6.setBackground(new Color(217, 229, 233));
        jPanel6.setPreferredSize(new Dimension(183, 200));

        jComboBox_Strenght = new JComboBox();
        jComboBox_Strenght.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"}));
        jComboBox_Agility = new JComboBox();
        jComboBox_Agility.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"}));
        jComboBox_Speed = new JComboBox();
        jComboBox_Speed.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"}));
        jComboBox_Jump = new JComboBox();
        jComboBox_Jump.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"}));
        jComboBox_Stamina = new JComboBox();
        jComboBox_Stamina.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"}));
        jComboBox_Throwing = new JComboBox();
        jComboBox_Throwing.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"}));

        jLabel_Strenght = new JLabel();
        jLabel_Stamina = new JLabel();
        jLabel_Speed = new JLabel();
        jLabel_Agility = new JLabel();
        jLabel_Jump = new JLabel();
        jLabel_Throwing = new JLabel();
        jButton_Calculate_Specialty = new JButton();
        jButton_Calculate_Specialty.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_Bereken_SpecialiteitActionPerformed(evt);
            }
        });

        jPanel6.add(jLabel_Strenght);
        jPanel6.add(jComboBox_Strenght);
        jPanel6.add(jLabel_Stamina);
        jPanel6.add(jComboBox_Stamina);
        jPanel6.add(jLabel_Speed);
        jPanel6.add(jComboBox_Speed);
        jPanel6.add(jLabel_Agility);
        jPanel6.add(jComboBox_Agility);
        jPanel6.add(jLabel_Jump);
        jPanel6.add(jComboBox_Jump);
        jPanel6.add(jLabel_Throwing);
        jPanel6.add(jComboBox_Throwing);
        jPanel6.add(new JLabel());
        jPanel6.add(jButton_Calculate_Specialty);

        jTable_CalculateSpecialty = new JTable();
        // jTable_BerekenSepcialiteit.setPreferredSize(new Dimension(200, 40));
        jTable_CalculateSpecialty.setModel(new javax.swing.table.DefaultTableModel(
                new Object[][]{},
                new String[]{}));
        jScrollPane = new JScrollPane();
        jScrollPane.setPreferredSize(new Dimension(183, 50));
        jScrollPane.setViewportView(jTable_CalculateSpecialty);

        jPanelEast = new JPanel();
        jPanelEast.setLayout(new BorderLayout());
        jPanelEast.add(BorderLayout.NORTH, jPanel6);
        jPanelEast.add(BorderLayout.CENTER, jScrollPane);


        jPanel7 = new JPanel();
        jPanel7.setLayout(new BorderLayout());

        jPanel8 = new JPanel();
       // jPanel8.setBackground(new Color(217, 229, 233));
        jPanel8.setLayout(new GridLayout(0, 1));
        jPanel8.add(jLabel_Calendar1 = new JLabel());
        jPanel8.add(jLabel_Calendar2 = new JLabel());
        jPanel8.add(jLabel_Calendar3 = new JLabel());
        jPanel8.add(jLabel_Calendar4 = new JLabel());
        jPanel8.add(jLabel_Calendar5 = new JLabel());

        jPanel10 = new ImagePanel(new ImageIcon("img/background.png").getImage());
        jPanel10.setPreferredSize(new Dimension(147, 125));
        jPanel10.add(jLabel_Date = new JLabel());
        jPanel10.add(jLabel_Athletes = new JLabel());
        jPanel10.add(jLabel_Youth = new JLabel());
        jPanel10.add(jLabel_Injury = new JLabel());
        jPanel10.add(jLabel_Fans1 = new JLabel());
        jPanel10.add(jLabel_AvgFans = new JLabel());
        jPanel10.add(jLabel_WageStatics = new JLabel());
        jPanel10.add(jLabel_AvgWage = new JLabel());
        jPanel10.add(jLabel_MAXID = new JLabel());
        jPanel10.add(jLabel_AvgMaxid = new JLabel());
        jPanel10.add(jLabel_AvgAge = new JLabel());
        jPanel10.add(jLabel_AvgForm = new JLabel());
        jPanel10.add(jLabel_AvgCare = new JLabel());
        jPanel10.add(jLabel_AvgExperience = new JLabel());
        jPanel10.add(jLabel_AvgMood = new JLabel());

        //jPanel12 = new JPanel(new GridLayout(15, 1));
        jPanel12 = new ImagePanel(new ImageIcon("img/background.png").getImage());
        jPanel12.setPreferredSize(new Dimension(147, 125));
        jPanel12.add(jLabel_DateOld = new JLabel());
        jPanel12.add(jLabel_TotalAthletesOld = new JLabel());
        jPanel12.add(jLabel_TotalYouthOld = new JLabel());
        jPanel12.add(jLabel_TotalInjuriesOld = new JLabel());
        jPanel12.add(jLabel_TotalFansOld = new JLabel());
        jPanel12.add(jLabel_FansDifferenceOld = new JLabel());
        jPanel12.add(jLabel_TotalWageOld = new JLabel());
        jPanel12.add(jLabel_WageDifferenceOld = new JLabel());
        jPanel12.add(jLabel_TotalMaxidOld = new JLabel());
        jPanel12.add(jLabel_MAXIDDifferenceOld = new JLabel());
        jPanel12.add(jLabel_AgeDifferenceOld = new JLabel());
        jPanel12.add(jLabel_FormDifferenceOld = new JLabel());
        jPanel12.add(jLabel_CareDifferenceOld = new JLabel());
        jPanel12.add(jLabel_ExperienceDifferenceOld = new JLabel());
        jPanel12.add(jLabel_MoodDifferenceOld = new JLabel());

        jPanel13 = new ImagePanel(new ImageIcon("img/background.png").getImage());
        jPanel13.setPreferredSize(new Dimension(147, 125));
        jPanel13.add(jLabel_DateNew = new JLabel());
        jPanel13.add(jLabel_TotalAthletesNew = new JLabel());
        jPanel13.add(jLabel_TotalYouthNew = new JLabel());
        jPanel13.add(jLabel_TotalInjuriesNew = new JLabel());
        jPanel13.add(jLabel_TotalFansNew = new JLabel());
        jPanel13.add(jLabel_FansDifferenceNew = new JLabel());
        jPanel13.add(jLabel_TotalWageNew = new JLabel());
        jPanel13.add(jLabel_WageDifferenceNew = new JLabel());
        jPanel13.add(jLabel_TotalMaxidNew = new JLabel());
        jPanel13.add(jLabel_MAXIDDiferenceNew = new JLabel());
        jPanel13.add(jLabel_AgeDifferenceNew = new JLabel());
        jPanel13.add(jLabel_FormDifferenceNew = new JLabel());
        jPanel13.add(jLabel_CareDifferenceNew = new JLabel());
        jPanel13.add(jLabel_ExperienceDifferenceNew = new JLabel());
        jPanel13.add(jLabel_MoodDifferenceNew = new JLabel());

        jPanel15 = new ImagePanel(new ImageIcon("img/background.png").getImage());
        jPanel15.setPreferredSize(new Dimension(147, 125));
        jPanel15.add(jLabel_Difference = new JLabel());
        jPanel15.add(jLabel_TotalAthlewsDifference = new JLabel());
        jPanel15.add(jLabel_TotalYouthDifference = new JLabel());
        jPanel15.add(jLabel_TotalInjuriesDifference = new JLabel());
        jPanel15.add(jLabel_TotalFansDifference = new JLabel());
        jPanel15.add(jLabel_FansDifference = new JLabel());
        jPanel15.add(jLabel_TotalWageDifference = new JLabel());
        jPanel15.add(jLabel_WageDifference = new JLabel());
        jPanel15.add(jLabel_TotalMaxid = new JLabel());
        jPanel15.add(jLabel_MAXIDDifference = new JLabel());
        jPanel15.add(jLabel_AgeDifference = new JLabel());
        jPanel15.add(jLabel_FormDifference = new JLabel());
        jPanel15.add(jLabel_CareDifference = new JLabel());
        jPanel15.add(jLabel_ExperienceDifference = new JLabel());
        jPanel15.add(jLabel_MoodDifference = new JLabel());

        jPanel14 = new JPanel(new BorderLayout());
        // jPanel12.setBackground(Color.CYAN);
        jPanel14.add(BorderLayout.CENTER, jPanel12);
      //  jPanel13.setBackground(Color.yellow);
        jPanel14.add(BorderLayout.EAST, jPanel13);

        jPanel11 = new JPanel(new BorderLayout());

        jPanel11.add(BorderLayout.WEST, jPanel10);
        jPanel11.add(BorderLayout.CENTER, jPanel14);
        jPanel11.add(BorderLayout.EAST, jPanel15);


        jPanel7.add(BorderLayout.NORTH, jPanel8);

        jPanel7.add(BorderLayout.CENTER, jPanel11);
        //jPanel7.add(BorderLayout.CENTER, jPanel9);
        //jPanelCentrum.add(BorderLayout.WEST, jPanelTeaminformatie);
        jPanelCentrum.add(BorderLayout.WEST, jPanelWest);
        jPanelCentrum.add(BorderLayout.EAST, jPanelEast);
        jPanelCentrum.add(BorderLayout.CENTER, jPanel7);
        //jPanelCentrum.add(BorderLayout.SOUTH, jPanel11);
        // Add components to GUI
        this.getContentPane().add(BorderLayout.NORTH, jMenuBar1);
        this.getContentPane().add(BorderLayout.CENTER, jPanelCentrum);
        this.setVisible(true);
    }

    private void fillTable() {
        SpecialiteitTableModel stm = new SpecialiteitTableModel(controller.calculateSpecialty(Integer.toString(0), Integer.toString(0), Integer.toString(0), Integer.toString(0), Integer.toString(0), Integer.toString(0), rb));
        stm.setColumnNames(rb.getString("DISCIPLINE"), rb.getString("VALUE"));
        jTable_CalculateSpecialty.setModel(stm);
        jTable_CalculateSpecialty.setAutoCreateRowSorter(true);
        jTable_CalculateSpecialty.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        TableColumn column = jTable_CalculateSpecialty.getColumnModel().getColumn(0);
        column.setPreferredWidth(130);
        column = jTable_CalculateSpecialty.getColumnModel().getColumn(1);
        column.setPreferredWidth(50);
        jTable_CalculateSpecialty.setVisible(true);
    }
}

class ImagePanel extends JPanel {

    private Image img;

    public ImagePanel(String img) {
        this(new ImageIcon(img).getImage());
    }

    public ImagePanel(Image img) {
        this.img = img;
        Dimension size = new Dimension(img.getWidth(null), img.getHeight(null));
        setPreferredSize(size);
        setMinimumSize(size);
        setMaximumSize(size);
        setSize(size);
        setLayout(new GridLayout(15, 1));
    }

    public void paintComponent(Graphics g) {
        g.drawImage(img, 0, 0, null);
    }
}